home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Unbuffered character input...
- Date: Thu, 08 Feb 96 15:45:47 GMT
- Organization: none
- Message-ID: <823794347snz@genesis.demon.co.uk>
- References: <Pine.SGI.3.91.960129190205.27936A-100000@tahiti.cs.unm.edu> <9602022043.AA13287@dxmint.cern.ch> <4f7hlf$87n@airdmhor.gen.nz> <9602061701.AA21789@dxmint.cern.ch> <4f8kat$ofv@solutions.solon.com>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4f8kat$ofv@solutions.solon.com>
- seebs@solutions.solon.com "Peter Seebach" writes:
-
- >In article <9602061701.AA21789@dxmint.cern.ch>,
- >Dan Pop <danpop@mail.cern.ch> wrote:
- >>But even on systems where it is not, it still saves processor time.
- >>The cpu overhead of making a single OS call to get a complete line of input
- >>is smaller (sometimes significantly smaller) than the overhead of making
- >>N OS calls, one for each character of the line. The stdio library tries
- >>to do its best to minimize the number of (expensive) OS calls.
-
- The stdio library typically reads characters as soon as they are available
- so it does very little in this respect except provide suitable buffering
- when more than one character happens to be available on a read. This is
- clearly significant for file I/O but whether terminal I/O makes user typed
- characters immediately available or not is usually purely a function of the
- OS. Setting line buffering on input streams on many/most stdio libraries
- doesn't do anything special.
-
- >Further, in some cases, it can be dramatically more uer efficient
- >and user friendly to be line buffered. The keyboard I'm typing
- >on right now is about 30 gateways from the editor I'm typing to.
- >If I were using a line buffered system, I would be able to see and correct
- >my typos *instantly* (Would you believe less than 50 msec.
- ...
-
- This is an argument for including support for line buffering, not against
- including support for unbuffered input. Both have their uses.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-